import http from './configHttp'

// 登录
export function login(params) {
  return http.get('/user/login', { params: params })
}
// 修改密码
export function updatePassword(params) {
  return http.post('/users/updatePassword', params)
}

// 新增小组
export function addGroup(params) {
  return http.post('/users/addGroup', params)
}
// 删除小组
export function deleteGroup(params) {
  return http.get('/users/deleteGroup', {
    params: params
  })
}
// 获取用户组列表
export function getAllGroup(params) {
  return http.get('/users/getAllGroup', {
    params: params
  })
}
// 新增用户
export function regist(params) {
  return http.post('/users/regist', params)
}
// 删除用户
export function deleteUser(params) {
  return http.get('/users/deleteUser', {
    params: params
  })
}
// 获取用户列表
export function getAllUser(params) {
  return http.get('/users/getUsers', {
    params: params
  })
}
// 获取用户可以审核的目标
export function getMyTarget(userId) {
  return http.get('/trial/getMyTarget', {
    params: {
      userId: userId
    } 
  })
}
// 获得小组内为用户分配的目标
export function getUserTarget(userId) {
  return http.get('/trial/getUserTarget', {
    params: {
      userId: userId
    }
  })
}
// 获取小组下的目标
export function getGroupTarget(groupId) {
  return http.get('/trial/getGroupTarget', {
    params: {
      groupId: groupId
    } 
  })
}
// 细分权限
export function setUserAuth(params) {
  return http.post('/users/assignTarget', params)
}
